----------------------------------------------------------------------------------------------------------------------------------
--[[

    花朵状态切换器

]]--
----------------------------------------------------------------------------------------------------------------------------------
local hutao_com_flower_switcher = Class(function(self, inst)
    self.inst = inst

    if not inst:HasTag("player") then
        self.__OverridePrefab = net_string(inst.GUID,"hutao_com_flower_switcher","hutao_com_flower_switcher_update")
        inst:ListenForEvent("hutao_com_flower_switcher_update", function(inst)
            local prefab = self.__OverridePrefab:value()
            if not (prefab and PrefabExists(prefab) and prefab ~= "flower") then
                return
            end
            if inst.SetPrefabName then
                inst:SetPrefabName(prefab)
            end
            if inst.SetPrefabNameOverride then
                inst:SetPrefabNameOverride(prefab)
            end
        end)
    else
        print("info hutao_com_flower_switcher : net_string install skip becase inst is player")
    end

end)
------------------------------------------------------------------------------------------------------------------------------
-- 
    function hutao_com_flower_switcher:SetOveridePrefab(prefab)
        if self.__OverridePrefab then
            self.__OverridePrefab:set(prefab)
        end
    end
------------------------------------------------------------------------------------------------------------------------------
return hutao_com_flower_switcher







